The present invention relates generally to computer systems, and more particularly to techniques for configuring computer systems for different byte orders.
Computer systems fall into two byte-order categories: big-endian and little-endian. Big-endian machines number the bytes in a word from zero to three (or zero to seven for a 64-bit word), with byte zero holding the sign bit and most significant bits. For half words, big-endian machines number the bytes zero and one, with byte zero holding the sign bit and most significant bits. Little-endian machines number the bytes of a word from three to zero. Byte three holds the sign bit and most significant bits. For half words, little-endian machines number the bytes one and zero. Byte one holds the sign bit and most significant bits. The byte order (endianness) of a computer system's CPU, firmware, and I/O system dictates the type of operating system and binary code that can run on that system.
Computer systems are normally manufactured with a particular byte order that cannot be altered by the end user. While manufacturers have designed components such as the CPU and I/O controllers that can be configured to operate in either byte-order mode, firmwave is normally one mode or the other. Thus, the configurable components are normally statically hard-wired by the manufacturers to operate in the same byte order as the computer firmware.
Unfortunately, some industry standard operating systems are big-endian and others are little-endian. While it is in principle possible to recompile and/or rewrite software to change its byte order, the firmware is fixed in ROM with a particular byte order. Thus, despite the reconfigurability of the hardware components, a user who wants to run programs under the Microsoft NT operating system (little-endian) and under the MIPS RISC/OS operating system (big-endian) has to make physical adjustments to the hardware, if possible, or in some cases, buy two machines.